/**
 * 
 */
package bible.sunflower.web.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

/**
 * @author Administrator
 *
 */
public class LoginController extends MultiActionController {
	
	Logger log = Logger.getLogger( LoginController.class );
	
	public ModelAndView login(HttpServletRequest req, HttpServletResponse resp)throws IOException{
		log.debug( "---sms center login---" );
		//resp.setCharacterEncoding("UTF-8");
		if("admin".equals(req.getParameter("username")) && "admin".equals(req.getParameter("pwd"))){
			req.getSession().setAttribute("custId", "admin");
			resp.getWriter().write("success");
		}else{
			resp.getWriter().write("用户名或密码出错!");
		}
		return null;
	}

}
